<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style type="text/css">
			#cotainer{
				width: 100%;
				height: 800px;
				display: flex;
				justify-content: center;
			}
			#OutDiv{
				width: 600px;
				height: 500px;
				overflow: hidden;
			}
			#ImgList{
				width: 1600px;
				height: 100px;
				display: flex;
				align-items: center;
				justify-content: center;
				margin-top: 200px;
			}
			#ImgList img{
				width: 100px;
				height: 100px;
			}
		</style>
	</head>
	<body>
		<div id="cotainer">
			<div id="OutDiv">
				<div id="ImgList" onmouseenter="doActionEnter();" onmouseleave="doActionLeave();">
					<img src="../img/lunbo/1.jpeg" >
					<img src="../img/lunbo/2.jpeg" >
					<img src="../img/lunbo/3.jpeg" >
					<img src="../img/lunbo/4.jpeg" >
					<img src="../img/lunbo/5.jpeg" >
					<img src="../img/lunbo/6.jpeg" >
					<img src="../img/lunbo/7.jpeg" >
					<img src="../img/lunbo/8.jpeg" >
					<img src="../img/lunbo/9.jpeg" >
					<img src="../img/lunbo/10.jpeg" >
					<img src="../img/lunbo/1.jpeg" >
					<img src="../img/lunbo/2.jpeg" >
					<img src="../img/lunbo/3.jpeg" >
					<img src="../img/lunbo/4.jpeg" >
					<img src="../img/lunbo/5.jpeg" >
					<img src="../img/lunbo/6.jpeg" >
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var ImgListObj = document.getElementById('ImgList');
		var marginLeft = 0;
		var myInterval = null;
		function doAction(){
				if (marginLeft == -1000) {
					marginLeft = 0;
				}
				marginLeft--;
				ImgListObj.style.marginLeft = marginLeft+'px';
				if(marginLeft%100==0){
					clearInterval(myInterval);
					console.log(myInterval);
					for (var i = 0; i <=myInterval; i++) {
						clearInterval(i);
					};
					setTimeout(function(){
						myInterval = setInterval(doAction,30);
					},1000)
				}
		}
		function doActionEnter(){
			clearInterval(myInterval);
			console.log(myInterval);
			for (var i = 0; i <=myInterval; i++) {
				clearInterval(i);
			}
		}
		function doActionLeave(){
			myInterval = setInterval(doAction,30);
		}
		onload = function(){
			myInterval = setInterval(doAction,30);
		}
	</script>
</html>